﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuickJob.lib;

namespace QuickJob.forms
{
    public partial class PreVies : Form
    {

        DropConfigView dcv;

        public PreVies()
        {
            InitializeComponent();
            pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
        }

        public PreVies(DropConfigItem item):this()
        {
            dcv = new DropConfigView(item, this.pictureBox1);

            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.AutoSize = true;
            //this.Size = new Size(pictureBox1.Size.Width + 20, pictureBox1.Size.Height + 20);
        }

        public void SaveImage(string Dir, string filename)
        {
            try {
                dcv.SaveBmp(Dir, filename);
            }
            catch { }
        }
    }
}
